#include "datarefreshthread.h"
#include <QtGlobal>
#include <QList>
#include "DopplerDrawScan.h"

DataRefreshThread::DataRefreshThread(QObject *parent) :
    QThread(parent)
{
    m_pList = NULL ;
    m_bStop = false ;
}

void DataRefreshThread::StopThread(bool bStop_)
{
    m_bStop = bStop_ ;
}

void DataRefreshThread::SetDrawList(QList<DopplerDrawScan*>* pList_)
{
    m_pList = pList_  ;
}

void DataRefreshThread::run()
{
    DopplerDrawScan* _pDraw ;
    int i  ;
    while(!m_bStop)
    {

        for(i = 0 ;  i < m_pList->count() ; i++)
        {
            _pDraw = m_pList->at(i) ;
            _pDraw->Draw();
            _pDraw->update();
            msleep(20);
        }
    }
}
